// 用户相关类型定义

// 用户角色枚举
export enum UserRole {
  SUPER_ADMIN = 'super_admin',
  INSTRUMENT_MANAGER = 'instrument_manager',
  INSTRUMENT_OPERATOR = 'instrument_operator',
  FINANCE = 'finance',
  LEVEL_1_USER = 'level_1_user',
  LEVEL_2_USER = 'level_2_user',
  LEVEL_3_USER = 'level_3_user',
}

// 用户状态枚举
export enum UserStatus {
  NORMAL = 'normal',
  DISABLED = 'disabled',
}

// 用户信息
export interface UserInfo {
  id: string;
  username: string;
  phone: string;
  email: string;
  realName: string;
  teamName?: string;
  role: UserRole;
  status: UserStatus;
  balance: number;
  isVerified: boolean;
  remark?: string;
  createdAt: string;
  updatedAt: string;
}

// 登录表单
export interface LoginForm {
  phone?: string;
  wechatCode?: string;
  loginType: 'phone' | 'wechat';
}

// 用户设置表单
export interface UserSettingsForm {
  role: UserRole;
  status: UserStatus;
}

// 用户个人信息表单
export interface UserProfileForm {
  realName: string;
  phone: string;
  email?: string;
  organization?: string;
  department?: string;
  position?: string;
  researchField?: string;
}

// 账户余额充值表单
export interface BalanceRechargeForm {
  userId: string;
  amount: number;
  remark?: string;
}

// 账单记录
export interface BillRecord {
  id: string;
  userId: string;
  operatorId: string;
  operatorName: string;
  type: 'recharge' | 'consume' | 'refund';
  amount: number;
  balance: number;
  remark?: string;
  createdAt: string;
}

// 用户搜索参数
export interface UserSearchParams {
  keyword?: string;
  role?: UserRole;
  status?: UserStatus;
  teamName?: string;
} 